package com.wwdx.model.dto;

import lombok.Data;

import java.io.Serializable;

/**
 * @author liguoliang
 */
@Data
public class ResultBean implements Serializable {

    public static final int FAIL = 1;

    private int status;

    private String message = "success";

    private Object data;

    public ResultBean() {}

    public ResultBean(Object data) {
        super();
        this.data = data;
    }

    public ResultBean(Throwable e) {
        super();
        this.message = e.toString();
        this.status = FAIL;
    }

    public ResultBean(Integer status,String msg) {
        super();
        this.status = status;
        this.message = msg;
    }

    public ResultBean(Integer status,String msg,Object obj) {
        super();
        this.status = status;
        this.message = msg;
        this.data = obj;
    }
}